<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>context</title>
    <link rel="stylesheet" href="../model/jsFn.css">
</head>
<body>
<div class="catalog">
    <h1>目录</h1>
    <ul>
        <li>
            <p><a href="#profile">context</a></p>
            <ul>
                <li><p><a href="#jsFn_naive.addLogic">context.naive.addLogic</a></p></li>
            </ul>
        </li>
    </ul>
</div>
<div id="profile">
    <h2>对象简介:</h2>
    <p>后台上下文</p>
</div>
<!--对象的某一个方法-->
<div class="jsFnModel" id="jsFn_naive.addLogic">
    <h3>context.naive.addLogic:</h3>
    <div class="shape">
        <h3>函数使用样式</h3>
        <p>context.naive.addLogic(event,fn) -> null</p>
    </div>
    <div class="profile">
        <h3>函数功能简介</h3>
        <p>注册一个逻辑入口,前端可通过ServerAgent.invoke(event,[data])调用</p>
    </div>
    <div class="version" style="background: #c3c363">
        <p>稳定性;1 - 不稳定的</p>
        <p>新增于:v0.0.0</p>
    </div>
    <div class="params">
        <h3>参数列表:</h3>
        <ul>
            <li>
                <p>event</p>
                <p>&nbsp;string&nbsp;</p>
                <p>逻辑入口名称,两个及以上相同的入口名称只有最后一个有效</p>
            </li>
            <li>
                <p>fn</p>
                <p>&nbsp;function&nbsp;</p>
                <p>fn(ctx,pck):调用入口后执行的函数;ctx:上下文;pck:前端传给后台的数据;</p>
            </li>
        </ul>
    </div>
    <div class="res">
        <h3>返回值:</h3>
        <p>null</p>
    </div>
    <div class="code">
        <h3>例子</h3>
        <pre>
            <code>
                context.naive.addLogic("login",async(ctx,pck)=>{
                    console.log('调用了登录的api');
                })
            </code>
        </pre>
    </div>
    <div class="error">
        <h3>抛出错误</h3>
    </div>
</div>
<div class="author"><p>by-草草</p></div>
</body>
</html>